
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>底部 - 小程序列表</title>


    <link rel="shortcut icon" href="favicon.ico">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="/Public/Admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>底部
                        <small>小程序列表</small>
                    </h5>

                </div>
                
                
                
                <div class="ibox-content">
                	<div>
                    	<button class="btn btn-primary " id="add" type="button"><i class="fa fa-check"></i>&nbsp;添加</button>
                    
                    	<button class="btn btn-info" id="edit" type="button"><i class="fa fa-paste" ></i> 编辑</button>
                        
                        <!--<button class="btn btn-danger " id="del" type="button"><i class="fa fa-remove" ></i>&nbsp;删除</button>-->

                    
                    </div>

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                        	<td>
                               <input type="checkbox" class="i-checks" onClick="$('input[name*=\'selected\']').prop('checked', this.checked);">
                            </td>
                            <th>序号</th>
                            <th>ID</th>
                            <th>排序</th>
                            <th>类型</th>
                            <th>标题</th>
                            <th>描述</th>
                            <th>按钮文字</th>
                            <th>小程序appid</th>
                            <th>url</th>
                            <th>版本</th>
                            <th>logo</th>
                            <th>是否是H5</th>
                            <th>是否显示</th>         
                        </tr>
                        </thead>
                        <tbody>
                        
                      	<?php 
                        
                        	if(! empty($data['game_list']))
                            {
                            	foreach($data['game_list'] as $key => $val)
                                {
                        ?>
                        <tr class="gradeX">
                        	<td>
                            
                            <input class="ids" type="checkbox" name="selected[]"  value="{$val['newsong_app_id']}">
                        
                            </td>
                            <td>{++$key;}</td>
                            <td>{$val['newsong_app_id']}</td>
                            <td>{$val['sort']}</td>
                            <td class="center">
                                <?php
                                    switch($val['category'])
                                    {
                                        //1小程序，2H5，3客服
                                       case 1:
                                            echo '小程序';
                                          break;

                                       case 2:
                                            echo 'H5应用';
                                          break;

                                       case 3:
                                            echo '客服';
                                          break;
                                    }
                                ?>

                            </td>
                            <td class="center">{$val['title']}</td>
                            <td class="center">{$val['content']}</td>
                            <td class="center">{$val['clicktitle']}</td>
                            <td class="center">{$val['appid']}</td>
                            <td class="center">{$val['url']}</td>
                            <td class="center">{$val['envversion']}</td>
                            <td class="center" style="width: 80px"><img width="100%" src="http://oss.beikg.cn/{$val['logo']}"/> </td>
                            <td class="center">{$val['h5show']}</td>
                            <td class="center">{$val['isshow']}</td>
                        </tr>
                        
                        
                        <?php
                        		}
                            }    
                        ?>
                        


                        </tbody>
                        
                    </table>

                </div>
            </div>
        </div>
    </div>

</div>

<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="/Public/Admin/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="/Public/Admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.js?v=1.0"></script>
<script type="text/javascript" src="/Public/Admin/js/contabs.min.js?v=1.0"></script>
<script>

$("#add").click(function()
{
	location.href = "{:U('GuessNewSong/game_list_add')}";
});

$("#edit").click(function()
{
	var id		=	[],
		id_val	=	0;
	$('input[name="selected[]"]:checked').each(function() {
		id.push($(this).val());
		id_val	=	$(this).val();
    });
	
	if(id.length == 0)
	{
		layer.msg('请选择要编辑的内容', {icon: 2});
		return false;
	}
	
	if(id.length > 1)
	{
		layer.msg('只能选择一条记录', {icon: 2});
		return false;
	}
	
	location.href = "{:U('GuessNewSong/game_list_edit')}?id="+id;

});

$("#del").click(function()
{

});

</script>
</body>

</html>
